package com.yunhe.option.service.base;

import com.yunhe.common.exception.ArgumentErrorException;
import com.yunhe.common.exception.ObjectNotFoundException;
import com.yunhe.common.exception.UniqueConstraintsException;
import com.yunhe.option.domain.base.SafetyGrade;
import org.springframework.transaction.annotation.Transactional;

/**
 * @ClassName SafetyGradeService
 * @Description 安全隐患评估类型服务
 * @Author HeTao
 * @Date 2020/11/3 14:25
 * @Version 1.0
 **/
public interface SafetyGradeService {

    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    SafetyGrade createSafetyGrade(SafetyGrade safetyGrade) throws UniqueConstraintsException, ArgumentErrorException;

    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    void deleteById(Long id);

    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    SafetyGrade updateSafetyGrade(SafetyGrade safetyGrade) throws ObjectNotFoundException, UniqueConstraintsException, ArgumentErrorException;

    @Transactional(rollbackFor = Exception.class, transactionManager = "transactionManager")
    SafetyGrade updateSafetyGrade(Long id, Long code, String name, String title, Long sn, Boolean activity) throws ObjectNotFoundException, UniqueConstraintsException, ArgumentErrorException;

    Iterable<SafetyGrade> findSafetyGrades();
}
